/*
 * @Author: your name
 * @Date: 2019-11-27 09:05:29
 * @LastEditTime: 2019-12-04 09:05:03
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \web\avue-cli\src\api\equipment\device\management.js
 */
import request from "@/router/axios";
import qs from "qs";

/**
 * @description: get设备设置列表
 * @param {object}
 * @return:promise
 */

// 维保申请单 --- 条件分页查询
export const getMaintenanceList = (data = {}) => request({
  url: `/maintenanceApplication/v1/pageQuery?page=${data.page}&size=${data.size}`,
  method: 'post',
  data: data.maintenanceApplication
})

// 维保申请单 --- 根据主键删除
export const getDeleteById = (data = {}) => request({
  url: '/maintenanceApplication/v1/getById',
  method: 'post',
  data: qs.stringify(data)
})

// 审核 --- 维保申请单
export const getApproved = (data = {}) => request({
  url: '/maintenanceApplication/v1/toExamine',
  method: 'post',
  data: qs.stringify(data)
})

// 修改 --- 维保申请单
export const updateMaintenanceList = (data = {}) => request({
  url: '/maintenanceApplication/v1/update',
  method: 'post',
  data: data
})

// 审批明细 --- 维保申请单
export const getProcessList = (data = {}) => request({
  url: '/maintenanceApplication/v1/processList',
  method: 'post',
  data: qs.stringify(data)
})

/**
 * 维保日历
 * @param data
 */
export const getMaintenanceCalendarList = (data = {}) => request({
    url: "/maintenanceApplication/v1/maintenanceCalendar",
    method: "post",
    data: qs.stringify(data)
});

/**
 * 维保日历查询设备
 * @param data
 */
export const getMaintenanceCalendarListEquipment = (data = {}) => request({
    url: "/maintenanceApplication/v1/maintenanceCalendarEquipment",
    method: "post",
    data: data
});

